package com.xigege.service;

import com.spring.annotation.Autowired;
import com.spring.annotation.Component;
import com.spring.annotation.Scope;
import com.spring.extend.BeanNameAware;
import com.spring.extend.InitializingBean;

@Component("userService")
@Scope("singleton")
public class UserServiceImpl implements BeanNameAware, InitializingBean, UserService {
    private String beanName;

    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    @Autowired
    private OrderService orderService;

    @Override
    public void test(){
        System.out.println(orderService);
    }

    @Override
    public void initBeanName(String name) {
       this.beanName = name;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("初始化");
    }
}
